﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Infrastructure.Managers;
using Resources;

namespace RhotCMS.Helpers
{
    public static class StoreHelpers
    {
        public static IEnumerable<string> GetCategories(string uiLangName, int parentCategoryId = 0)
        {
            var storeManager = new StoreManager();
            var categories = storeManager.GetCategoriesByParentId(uiLangName, parentCategoryId).Select(p => p.Name);

            if (categories.Count<string>() == 0)
            {
                return new string[1] { Literals.Empty }.AsEnumerable();
            }

            return categories;
        }
    }
}